﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SIPO.master" AutoEventWireup="false" 
CodeFile="rptTargetPenerimaanlist_bck.aspx.cs" Inherits="SIPO.Web.lists.Report.rptPenerimaanlist" %>

<asp:Content ID="ctnBody" ContentPlaceHolderID="body" runat="server">

    <script src="<%= ResolveUrl("~/scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/scripts/jquery.validate.wrapper.js") %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/scripts/helper.js") %>" type="text/javascript"></script>
   
   
 
    <script type="text/javascript">
        $("#btnCancel").button({ icons: { primary: "ui-icon-close"} });
        $("#<%=Button1 %>").button({ icons: { primary: "ui-icon-print"} });
    </script>
   
	    <script type="text/javascript">
	        $(document).ready(function () {
	            //	            $("#<%=ddlPeriode0.ClientID %>").attr('disabled', 'disabled');
	            //	            $("#<%=ddlPeriode1.ClientID %>").attr('disabled', 'disabled');
	            //	            $("#<%=ddlPeriode0.ClientID %>").val('');
	            //	            $("#<%=ddlPeriode1.ClientID %>").val('');



	            if ($("#<%=ddlPeriode0.ClientID %>").val() > $("#<%=ddlPeriode1.ClientID %>").val()) {
	                alert("Periode tidak valid !");
	            }
	            $("#<%=ddlPeriode0.ClientID %>").change(function () {
	                if ($("#<%=ddlPeriode0.ClientID %>").val() == $("#<%=ddlPeriode1.ClientID %>").val()) {
	                    $("#trVersi").show();
                        var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Loaddata/getAcceptanceDetail.ashx?method=getdataversion") %>';
	                    $citys = $("#<%=ddlVersi.ClientID %>");
	                    $citys.get(0).options.length = 0;
	                    $.ajax({
	                        type: 'POST',
	                        url: handlerUrl + '&Period=' + $("#<%=ddlPeriode0.ClientID %>").val(),
	                        contentType: 'application/json',
	                        dataType: 'json',
	                        success: function (datas) {

	                            if (datas.length > 1) {
	                                //    $citys.get(0).options[0] = new Option("versi", "");
	                                $.each(datas, function (i, data) {
	                                    $citys.append('<option value="' + data.Versi + '">' + data.Versi + '</option>');
	                                });

	                            } else if (datas.length == 1) {
	                                $citys.append('<option value="' + datas[0].Versi + '">' + datas[0].Versi + '</option>');
	                            }

	                            $citys.trigger('chosen:updated');

	                        },
	                        error: function () {
	                            alert('Error!');
	                        }
	                    });
	                }
	                else {
	                    $("#trVersi").hide();
	                    $citys = $("#<%=ddlVersi.ClientID %>");
	                    $citys.get(0).options.length = 0;
	                    //   $citys.get(0).options[0] = new Option("versi", "");
	                    $citys.trigger('chosen:updated');
	                }


	                //                }
	                //                else
	                //                {
	                //                
	                //                }

	            });

	           // $("#trVersi").hide();

	            $("#<%=ddlPeriode1.ClientID %>").change(function () {
	               
	                if ($("#<%=ddlPeriode0.ClientID %>").val() == $("#<%=ddlPeriode1.ClientID %>").val()) {
	                    $("#trVersi").show();
	                    var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Loaddata/getAcceptanceDetail.ashx?method=getdataversion") %>';
	                    $citys = $("#<%=ddlVersi.ClientID %>");
	                    $citys.get(0).options.length = 0;
	                    $.ajax({
	                        type: 'POST',
	                        url: handlerUrl + '&Period=' + $("#<%=ddlPeriode0.ClientID %>").val(),
	                        contentType: 'application/json',
	                        dataType: 'json',
	                        success: function (datas) {

	                            if (datas.length > 1) {
	                                //  $citys.get(0).options[0] = new Option("versi", "");
	                                $.each(datas, function (i, data) {
	                                    $citys.append('<option value="' + data.Versi + '">' + data.Versi + '</option>');
	                                });

	                            } else if (datas.length == 1) {
	                                $citys.append('<option value="' + datas[0].Versi + '">' + datas[0].Versi + '</option>');
	                            }

	                            $citys.trigger('chosen:updated');

	                        },
	                        error: function () {
	                            alert('Error!');
	                        }
	                    });
	                }
	                else {
	                    $("#trVersi").hide();
	                    $citys = $("#<%=ddlVersi.ClientID %>");
	                    $citys.get(0).options.length = 0;
	                    //    $citys.get(0).options[0] = new Option("versi", "");
	                    $citys.trigger('chosen:updated');
	                }


	                //                }
	                //                else
	                //                {
	                //                
	                //                }

	            });



	            $("#btnCancel").click(function () {

	                $("#<%=ddlPeriode0.ClientID %>").prop('selectedindex', 0);
	                $("#<%=ddlPeriode1.ClientID %>").prop('selectedindex', 0);
	            });

	            //	                
	            //	            $("#txtPeriodeAwal").datepicker({ showWeek: true, showButtonPanel: true,
	            //	                changeYear: true, dateFormat: 'yy',
	            //	              //  numberOfMonths: 1,
	            //	                onSelect: function (selected) {
	            //	                    $("#txtPeriodeAkhir").datepicker("option", "minDate", selected)
	            //	                },
	            //	                onClose: function (dateText, inst) {
	            //	                    var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
	            //	                    $(this).datepicker('setDate', new Date(year, 1));
	            //	                }
	            //	            });

	            //	            $("#txtPeriodeAkhir").datepicker({ showWeek: true, showButtonPanel: true,
	            //	               changeYear: true, dateFormat: 'yy',
	            //	              //  numberOfMonths: 1,
	            //	                onSelect: function (selected) {
	            //	                    $("#txtPeriodeAwal").datepicker("option", "maxDate", selected)
	            //	                },
	            //	                onClose: function (dateText, inst) {
	            //	                    var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
	            //	                    $(this).datepicker('setDate', new Date(year, 1));
	            //	                }
	            //	            });

	            //	            $("#txtPeriodeAkhir").focus(function () {
	            //        $(".ui-datepicker-month").hide();
	            //    });
	            //    $("#txtPeriodeAwal").focus(function () {
	            //        $(".ui-datepicker-month").hide();
	            //    });
	        });
           </script>
   
  
  
   

    <h2>Laporan Target Penerimaan</h2>

<table>
    
   
    
    <tr>
        <td style="width: 50">
           Pilih Tahun
        </td>
        <td>:</td>
        <td><asp:DropDownList ID="ddlPeriode0" runat="server" Width="88px"></asp:DropDownList>&nbsp;-
            <asp:DropDownList ID="ddlPeriode1" runat="server" Width="88
            "></asp:DropDownList>&nbsp;</td>
    </tr>
     <tr id="trVersi">
        <td style="width: 50">
           &nbsp;Versi
        </td>
        <td>:</td>
        <td><asp:DropDownList ID="ddlVersi" runat="server" Width="88px"></asp:DropDownList>&nbsp;
            &nbsp;</td>
    </tr>
    <tr>
            <td colspan="2">
                &nbsp;
            </td>
            <td>
                <div style="text-align: right; padding-top: 10px;">
                <asp:Button ID="Button1" runat="server" Text="Cetak" onclick="Button1_Click" />
                       
                       
                    &nbsp;&nbsp;     
                       
                      
                      <input type="button" id="btnCancel" value="Batal" />
                </div>
            </td>
        </tr>
</table>
    <asp:HiddenField ID="hfPeriodeKe" runat="server" />
    <asp:HiddenField ID="hfPilihPeriode" runat="server" />
    <%--<asp:HiddenField ID="hfSubSubSektorID" runat="server" />
    <asp:HiddenField ID="hfTransTypeID" runat="server" />
    <asp:HiddenField ID="hfPeriodeAwal" runat="server" />
    <asp:HiddenField ID="hfPeriodeAkhir" runat="server" />
    <asp:HiddenField ID="hfDetail" runat="server" /--%>&nbsp;<br />
    <br />
<div>
        <asp:ScriptManager ID="scManager" runat="server" EnablePartialRendering="true">
        </asp:ScriptManager>
        <rsweb:ReportViewer ID="rsViewer" 
            runat="server" Height="100%" SizeToReportContent="true" Width="100%" 
            HyperlinkTarget="_blank" AsyncRendering="False" KeepSessionAlive="False">
        </rsweb:ReportViewer>
         
    
    </div>
    
 
</asp:Content>